home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / startrek / misc / plot-game.c < prev    next >
Text File  |  1995-08-20  |  6KB  |  298 lines

  1. Path: newserv.ksu.ksu.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!newsrelay.iastate.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!swrinde!dptspd!TAMUTS.TAMU.EDU!news
  2. From: grw@tamu.edu (George R. Welch)
  3. Newsgroups: alt.startrek.creative
  4. Subject: RE:  PLOT GAME
  5. Date: 15 Nov 1993 23:00:48 GMT
  6. Organization: Texas A&M University Atomic Physics
  7. Lines: 284
  8. Distribution: world
  9. Message-ID: <2c91n0$apb@TAMUTS.TAMU.EDU>
  10. NNTP-Posting-Host: leona.tamu.edu
  11. X-Newsreader: <WinQVT/Net v3.9>
  12.  
  13.  
  14. Recently chanley@wpi.edu (Christopher S Hanley) wrote
  15. > ...
  16. > Here it is fans!!!  The first build yer own TNG plot guide!!! 
  17. > Just pick an item from each category and... Voila!!! Your
  18. > own unique TNG plot!  Add new entries to each category! 
  19. > ...
  20.  
  21.     This reminded me of a little C program that used
  22. to float around, so I thought I'd give it a whirl.
  23.  
  24.     I have no idea how portable the random number junk
  25. is, so your mileage may vary:
  26.  
  27. /*----------------------  Snip Snip  ---------------------*/
  28.  
  29. #include <stdio.h>
  30. #include <time.h>
  31. #include <ctype.h>
  32. #include <stdlib.h>
  33.  
  34. static char     *Name[] = {
  35.     "The starship Enterprise,",
  36.     "Captain Picard,",
  37.     "Data,",
  38.     "Commander Riker,",
  39.     "Deanna Troi,",
  40.     "Bevery Crusher,",
  41.     "Lt. Worf,",
  42.     "Geordi LeForge,",
  43.     "Wesley Crusher,",
  44.     "Guinan,",
  45.     "The crew of the Enterprise,",
  46.     "A partial shuttlecraft crew,",
  47.     "Star Fleet,",
  48.     "Earth,",
  49.     "A member of the original series,",
  50. };
  51.  
  52. static char     *_while[] = {
  53.         "while",
  54. };
  55.  
  56. static char    *doing1[] = {
  57.     "on routine patrol,",
  58.     "en route to Starbase IV,",
  59.     "investigating an unexplored planet,",
  60.     "observing a nova,",
  61.     "transporting diplomats,",
  62.     "on shore leave,",
  63.     "at Ten Forward,",
  64.     "endulging in a holodeck fantasy,",
  65.     "drinking Earl Grey tea,",
  66.     "on duty,",
  67.     "playing poker,",
  68.     "tap dancing,",
  69.     "playing the trombone,",
  70.     "wishing for more humanity,",
  71.     "floating through space,",
  72.     "sleeping peacefully,",
  73.     "on a rescue mission,",
  74.     "on the verge of insurrection,",
  75.     "repairing asteriod damage,",
  76.     "watching a performance,",
  77.     "engaging in diplomacy,",
  78.     "recovering from heatbreak,",
  79. };
  80.  
  81. static char    *has[] = {
  82.     "is attacked by",
  83.     "is captured by",
  84.     "is possessed by",
  85.     "is propositioned by",
  86.     "falls in love with",
  87.     "is seduced by",
  88.     "is recruited by",
  89.     "disappears into",
  90.     "is disabled by",
  91.     "gets lost in",
  92.     "has sex with",
  93.     "leaves Star Fleet for",
  94.     "is trapped with",
  95.     "finds",
  96.     "is reunited with",
  97.     "is invaded by",
  98.     "has a fantasy about",
  99.     "is called into duty with",
  100.     "recalls a past incident with",
  101.     "is impregnated by",
  102. };
  103.  
  104. static char    *something1[] = {
  105.     "a Romulan Bird of Prey",
  106.     "the Klingon High Council",
  107.     "Q",
  108.     "a wormhole",
  109.     "the ship's computer",
  110.     "a time distortion",
  111.     "a holodeck fantasy",
  112.     "a mysterious probe",
  113.     "a Ferengi",
  114.     "a trader",
  115.     "an upstart officer",
  116.     "strange delusions",
  117.     "a Star Fleet bureaucrat",
  118.     "the Borg",
  119.     "a Vulcan emissary",
  120.     "an unexplained illness",
  121.     "an exotic culture",
  122.     "a sexy alien",
  123.     "a maverick archeologist",
  124.     "Troi's mother",
  125.     "Worf's parents",
  126.     "an energy anomaly",
  127.     "a warp core breach",
  128.     "a transporter accident",
  129.     "Data",
  130.     "Captain Picard",
  131.     "Alexander",
  132. };
  133.  
  134. static char    *but[] = {
  135.     "but overcomes disaster by",
  136. };
  137.  
  138. static char    *doing2[] = {
  139.     "firing",
  140.     "converting",
  141.     "talking",
  142.     "diverting",
  143.     "throwing",
  144.     "launching",
  145.     "tricking",
  146.     "rerouting",
  147.     "running",
  148.     "seducing",
  149.     "asking",
  150.     "bouncing",
  151.     "recalling",
  152.     "singing",
  153.     "emptying",
  154.     "warping",
  155. };
  156.  
  157. static char    *something2[] = {
  158.     "a phaser",
  159.     "the ship's computer",
  160.     "a star's corona",
  161.     "Data's circuits",
  162.     "Geordi's visor",
  163.     "the warp engines",
  164.     "the deflector shields",
  165.     "a tricorder",
  166.     "the ship's sensors",
  167.     "holodeck images",
  168.     "the transporter",
  169.     "a shuttle craft",
  170.     "a Klingon opera",
  171.     "the prime directive",
  172.     "the ship's phasers",
  173.     "a photon torpedo",
  174.     "Spot the cat",
  175. };
  176.  
  177. static char    *into[] = {
  178.     "into",
  179. };
  180.  
  181. static char    *thing[] = {
  182.     "a one-time-only sonic pulse;",
  183.     "a tachyon-particle disperser;",
  184.     "giving up;",
  185.     "leaving Star Fleet;",
  186.     "a baryon field coil;",
  187.     "compensator;",
  188.     "a different time-line;",
  189.     "breaking up;",
  190.     "doing it again;",
  191.     "a pattern-matching quantum-energy emitter;",
  192.     "a logical implausibility;",
  193.     "a matter-anti-matter overload;",
  194.     "a communicator;",
  195.     "disrobing;",
  196.     "self-destruction;",
  197. };
  198.  
  199. static char    *thereby[] = {
  200.     "thereby reaffirming that",
  201. };
  202.  
  203. static char    *they[] = {
  204.     "all life forms",
  205.     "Star Fleet enemies",
  206.     "24th century customs",
  207.     "the members of the Enterprise crew",
  208.     "Star Fleet bureaucrats",
  209.     "men and women both",
  210.     "aliens",
  211.     "space babes",
  212.     "space hunks",
  213.     "future technologies",
  214.     "different ideologies",
  215.     "space-time paradoxes",
  216.     "the Q continuum",
  217.     "Star Trek fans",
  218. };
  219.  
  220. static char    *are[] = {
  221.     "are precious.",
  222.     "will believe anything.",
  223.     "are \"bad\".",
  224.     "are deep and meaningful.",
  225.     "will never learn.",
  226.     "are worthy of respect.",
  227.     "are hot.",
  228.     "deserve another chance.",
  229.     "are an accident waiting to happen.",
  230.     "are short-lived.",
  231.     "are the pride of the fleet.",
  232.     "have better things to do.",
  233.     "can't get enough.",
  234. };
  235.  
  236. struct table {
  237.         char    **item;
  238.         short   len;
  239. };
  240.  
  241. typedef struct table    TABLE;
  242. #define SZ(a)           sizeof(a) / sizeof(char *)
  243.  
  244. TABLE   list[] = {
  245.     Name,        SZ(Name),
  246.     _while,        SZ(_while),
  247.     doing1,        SZ(doing1),
  248.     has,        SZ(has),
  249.     something1,    SZ(something1),
  250.     but,        SZ(but),
  251.     doing2,        SZ(doing2),
  252.     something2,    SZ(something2),
  253.     into,        SZ(into),
  254.     thing,        SZ(thing),
  255.     thereby,    SZ(thereby),
  256.     they,        SZ(they),
  257.     are,        SZ(are),
  258.         (char **)NULL,  (short)NULL,
  259. };
  260.  
  261. #define LLINE   50
  262. static short    lwidth;
  263.  
  264. void    outsp() {
  265.         if (lwidth > LLINE) {
  266.                 putchar('\n');
  267.                 lwidth = -1;
  268.         }
  269.         else
  270.         putchar(' ');
  271. }
  272.  
  273. main() {
  274.     TABLE  *ttp;
  275.      char   *cp;
  276.         long       now;
  277.     double    f;
  278.     int    j;
  279.  
  280.         now = time(&now);
  281.         srand((unsigned int)now);
  282.  
  283.         for (ttp = list; ttp->item; ++ttp, ++lwidth) {
  284.         f = (double)rand() - .1;
  285.         j = (int)(f/RAND_MAX*ttp->len);
  286.                 for (cp = ttp->item[j]; *cp; ++cp, ++lwidth) {
  287.                         if (isspace(*cp))
  288.                 outsp();
  289.                         else
  290.                 putchar(*cp);
  291.         }
  292.                 outsp();
  293.         }
  294.         if (lwidth)
  295.         putchar('\n');
  296. }
  297.  
  298.